import Vue from 'vue';
import myLoading from './loading.vue'
const Loading = Vue.extend(myLoading);
const $loading = new Loading({
    el: document.createElement('div')
})
$loading.show = false;
const result = {
    show(msg) {
        $loading.show = true;
        $loading.msg = msg
        document.body.appendChild($loading.$el)
    },
    hide() {
        $loading.show = false
    }
}
export default {
    install() {
        if (!Vue.result) {
            Vue.result = result;
        }
        Vue.mixin({
            created() {
                this.result = Vue.result;
            }
        })
    }
}